// with polyfills
import 'core-js/stable'
import 'regenerator-runtime/runtime'

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/'
import i18n from './locales'
import { VueAxios } from './utils/request'
import ProLayout, { PageHeaderWrapper } from '@ant-design-vue/pro-layout'
import themePluginConfig from '../config/themePluginConfig'

// mock
// WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
// import './mock'

import bootstrap from './core/bootstrap'
import './core/lazy_use' // use lazy load components
import './permission' // permission control
import './utils/filter' // global filter
import './global.less' // global style
import config from '@/config/system.config'
import api from '@/api/upload.js'
Vue.prototype.$api = api
import reg from '@/utils/reg';
Vue.prototype.$reg = reg;
import myUtils from '@/utils/myUtils.js';
Vue.prototype.$myUtils = myUtils;
//vue原型链挂载总线
Vue.prototype.bus = new Vue();
//引入该模块的接口
import productApi from '@/api/product.js'
Vue.prototype.$productApi = productApi
// import KFormDesign from 'k-form-design'
// import 'k-form-design/lib/k-form-design.css'
// Vue.use(KFormDesign)
// 引入全局自定义配置文件
Vue.CONFIG = Vue.prototype.$CONFIG = config

Vue.config.productionTip = false

// mount axios to `Vue.$http` and `this.$http`
Vue.use(VueAxios)
// use pro-layout components
Vue.component('pro-layout', ProLayout)
Vue.component('page-container', PageHeaderWrapper)
Vue.component('page-header-wrapper', PageHeaderWrapper) // PageHeader 页头

window.umi_plugin_ant_themeVar = themePluginConfig.theme

new Vue({
  router,
  store,
  i18n,
  // init localstorage, vuex
  created: bootstrap,
  render: h => h(App)
}).$mount('#app')
